IIf(condition, string_expression1, string_expression2)


For error handling, see CFTRY/ CFCATCH.

See also DE and Evaluate.

condition

Any expression that can be evaluated as a Boolean.

string_expression1

Valid string expression to be evaluated and returned if condition is TRUE.

string_expression2

Valid string expression to be evaluated and returned if condition is FALSE.

<CFOUTPUT>
#<IIf(IsDefined("LocalVar"), "LocalVar", DE("The variable is not 
defined.")>#
</CFOUTPUT>
The variable is not defined.
<CFOUTPUT>
<IIf(IsDefined("LocalVar"), DE("#LocalVar#"), DE("The variable is not 
defined.")>
</CFOUTPUT>
Error resolving parameter LOCALVAR